/*
* @Author: dengjiayao
* @Date:   2017-06-26 09:05:10
 * @Last Modified by: songwh
 * @Last Modified time: 2018-03-29 14:55:12
*/

import Vue from '../vue'
import store from '../vuex/store'
import { alert } from 'vue-strap'
import loginCheck from '../util/login-check'

import UserList from './user-list/user-list.vue'
import UserConfig from './user-config/user-config.vue'

new Vue({
  el: 'body',
  components: {
    'vue-alert-msg': alert,
    'vue-user-list': UserList,
    'vue-user-config': UserConfig
  },
  store,
  created() {
    loginCheck(this)
  },
  vuex: {
    getters: {
      msg: state => state.msg
    }
  },
  methods: {
    newUser() {
      var config = this.$refs.userConfig
      config.actionType = 'ADD'
      config.form = {
        name: '',
        mobile: '',
        company: '',
        department: '',
        jobTitle: '',
        email: '',
        remark: ''
      }
      config.showModal = true
    }
  }
})
